Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto-scroll should not pause on invisible activities #3945

Merged
merged 4 commits into from
Jun 29, 2021

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Jun 14, 2021

Fixes #3943.

Changelog Entry

Fixed

  • Fixes #3943. Auto-scroll should skip invisible activities, such as post back or event activity, by @compulim, in PR #3945

Description

When we compute when to pause the scroll, we based on the offsetTop of "last acknowledged activity" (LAA). When the end-user send a message, the LAA will be that message.

If the LAA is an invisible activity, such as post back, message back, or event activity, we will not able to get the offsetTop because the LAA is not rendered.

This fix is to compute the offsetTop based on the "first visible activity after the LAA", instead of LAA itself.

Design

Specific Changes

  • Modify the scroller callback to find out "first visible activity after the LAA" and use it for all computations
  • Add 3 tests to make sure invisible activities from both side (bot/user) works with both "pause auto-scroll behavior" (num activities or num pages)
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review June 15, 2021 04:41
Copy link
Member

@cwhitten cwhitten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple comments

@compulim
Copy link
Contributor Author

Done. Ready for another round.

@compulim compulim merged commit a02be76 into microsoft:main Jun 29, 2021
@compulim compulim deleted the fix-auto-scroll-postback branch June 29, 2021 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Pause auto-scroll" doesn't play well with AC with Action.Submit/PostBack buttons
2 participants